﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace A93流程控制_判断
{
    class Program
    {
        //if 案例1
        static void Main1(string[] args)
        {
            int a = 5;
            int b = 6;
            if (a>b)
            {
                Console.WriteLine("a大于b");
            }
            else
            {
                Console.WriteLine("a小于b");
            }
        }
        //if 案例2 判断一个属是否为偶数
        static void Main2(string[] args)
        {
            int a = 131231242;
            if (a % 2 == 0)
            {
                Console.WriteLine("是偶数");
            }
        }
        //if 案例3 多条件判断
        static void Main3(string[] args)
        {
            //判断成绩等级   >=90优秀   >=70良好    >=60及格    <60不及格
            Console.WriteLine("请输入成绩:");
            int score = int.Parse( Console.ReadLine());
            if (score>=90)
            {
                Console.WriteLine("优秀");
            }
            else if (score>=70 )
            {
                Console.WriteLine("良好");
            }
            else if (score>=60)
            {
                Console.WriteLine("及格");
            }
            else
            {
                Console.WriteLine("不及格");
            }
        }

        //switch  只能判断相等的情况,可以用if取代的

        //switch 案例1
        static void Main4(string[] args)
        {
            Console.WriteLine("欢迎致电10086");

            Console.WriteLine("话费查询请按1");
            Console.WriteLine("流量查询请按2");
            Console.WriteLine("宽带办理请安3");
            Console.WriteLine("人工服务请按0");

            while (true)
            {
                int input = int.Parse(Console.ReadLine());
                switch (input)
                {
                    case 1:
                        Console.WriteLine("您已欠费");
                        break;
                    case 2:
                        Console.WriteLine("没流量了");
                        break;
                    case 3:
                        Console.WriteLine("已经帮您预约安装人员");
                        break;
                    case 0:
                        Console.WriteLine("人工服务器忙,继续等待请按#");
                        break;
                    default:
                        Console.WriteLine("没有这选项");
                        break;
                }
            }
            

        }

        //switch案例2  条件贯穿
        static void Main(string[] args)
        {
            Console.WriteLine("请输入星期几");
            string day = Console.ReadLine();
            switch (day)
            {
                case "1":
                case "2":
                case "3":
                case "4":
                case "5":
                    Console.WriteLine("上课");
                    break;
                case "6":
                    Console.WriteLine("自习");
                    break;
                case "7":
                    Console.WriteLine("休息");
                    break;
            }
        }
    }
}
